# some area's below will eventually be replaced by audit table variable

db.define_table('feature',
    Field('name'),                                         # Applications full name ie. uc_aria
    Field('title', 'text'),                                # Name that appears in menu's etc "aria"
    Field('description', 'text'),                          # Application description
    Field('menu'),                                         # Menu this item is assigned ie. "main, settings ..."
    Field('active', 'boolean'),                            # Must be active to show up in menu
    Field('created_on', 'datetime', default=request.now),  # Date of creation.
    Field('created_by', db.auth_user, default=user_id))    # User id of creator


# some area's below will eventually be replaced by audit table variable
# 

db.feature.name.requires = [IS_NOT_EMPTY(), IS_NOT_IN_DB(db, 'feature.name')] 
db.feature.title.requires = [IS_NOT_EMPTY(), IS_NOT_IN_DB(db, 'feature.title')]
db.feature.description.requires = IS_NOT_EMPTY()
db.feature.menu.requires = IS_NOT_EMPTY()        ## probably want to add a drop down here at some point.
db.feature.created_by.readable = False
db.feature.created_by.writable = False 
db.feature.created_on.readable = False 
db.feature.created_on.writable = False
